package com.xwl.estore.servlet;  
  
import java.io.IOException;  
import java.io.PrintWriter;  
  
import javax.annotation.Resource;  
import javax.servlet.ServletException;  
import javax.servlet.http.HttpServlet;  
import javax.servlet.http.HttpServletRequest;  
import javax.servlet.http.HttpServletResponse;  
  
import org.springframework.context.annotation.Scope;  
import org.springframework.stereotype.Controller;  
  
import com.xwl.estore.service.UserService;  
  
@SuppressWarnings("serial")  
@Controller  
@Scope("prototype")  
public class HelloServlet extends HttpServlet {  
  
	@Resource 
    private UserService userService;  
      
 
  
    public void doGet(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        System.out.println("Get");  
        PrintWriter out = response.getWriter();  
        out.println(userService.sayHello("Hello,Spring.Servlet"));    
    }  
  
    public void doPost(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        System.out.println("Post");  
        PrintWriter out = response.getWriter();  
        out.println(userService.sayHello("Hello,Spring.Servlet"));        
    }  
  
}